This forum is closed to new posts and
responses. The content has been migrated to the Digital Solutions Community. Please join us there for new content as well as this content. For customer support, please visit the official HCL customer support channels below:
Subject: URGENT : How to extract file attachments that are not a part of the "Body" from notes messages ?
Feedback Type: Question
Product Area: Domino Designer on Eclipse (DDE)
Technical Area: Customization
Platform: Windows XP client
Release: 8.5
Reproducible: Not applicable
we have a requirement to extract all the file attachments from notes messages in JAVA. We cannot use lotus scripts!
I am using the Notes getEmbeddedObjects() of RichTextItem to get all the attachments that are present in the "Body" of the message :
below is the code -
RichTextItem body = (RichTextItem)doc.getFirstItem("Body");
Vector v = body.getEmbeddedObjects();
Enumeration e = v.elements();
while (e!=null && e.hasMoreElements()) {
EmbeddedObject eo = (EmbeddedObject)e.nextElement();
//check if the object is a file attachment
String type = getObjectType(eo);
if (type.equals("file attachment")){
eo.extractFile("C:\\extracts\\"+eo.getSource());
}
}
This approach fails when we have a message with just attachments and No Body (RichTextItem cannot be used as the attachment is not a part of the "Body" ).
Please let me know if you are aware of an alternate solution to extract attachments that are NOT a part of the Body or to extract attachments from messages that do not have a body.
Thanks !
Feedback number WEBB7PJN64 created by ~Tony Frogeroskiader on 02/23/2009
Status: Open
Comments: